package cn.tdeu.spring.config;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

public class TestJdbc {
    public static void main(String[] args) {
        //IoC容器: JdbcTemplate
        ApplicationContext context = new AnnotationConfigApplicationContext(JdbcTemplateConfig.class);
        //获取该对象
        JdbcTemplate template = context.getBean(JdbcTemplate.class);
        //执行SQL
        template.execute("INSERT INTO user(username, password) VALUES ('薛杉杉','123456')");
    }
}
